import Router from '@koa/router';
import * as memberController from '../controllers/member.controller';
import { authMiddleware } from '../middleware/auth';

const router = new Router({
  prefix: '/api/members',
});

// 所有路由都需要认证
router.use(authMiddleware);

// 创建会员
router.post('/create', memberController.createMember);

// 更新会员
router.post('/update', memberController.updateMember);

// 删除会员
router.post('/delete', memberController.deleteMember);

// 查询会员列表
router.post('/list', memberController.getMemberList);

// 查询会员详情
router.post('/detail', memberController.getMemberDetail);

export default router;

